<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>五指山污水处理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/css/public.css" media="all">
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/huazhi/images/favicon.ico"/>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/logincss/layout.css" media="all">
</head>
<style>
    /* 底部固定区域 */
    .layui-layout-admin .layui-footer {
        padding: 10px 0;
        text-align: center;
    }

    .layui-layout-admin .layui-footer {
        background-color: #fff;
    }

    .el-input__suffix {
        position: absolute;
        height: 100%;
        right: 5px;
        top: 0;
        text-align: center;
        color: #c0c4cc;
        transition: all .3s;
        pointer-events: none;
    }

</style>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <form class="layui-form" lay-filter="component-form-element" id="form" method="post" >
                <input type="hidden" name="id" id="id">
                <div class="layui-tab layui-tab-brief">
                    <div class="layui-tab-content" style="height: auto">
                        <div class="layui-tab-item layui-show">
                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs11">
                                        <label class="layui-form-label">村庄名称</label>
                                        <div class="layui-input-block">
<%--                                            <select type="text" id="cun"  name="cun" lay-filter="cun-filter">--%>
<%--                                            </select>--%>
                                       <input id="cun" class="layui-input" name="cun" type="text" autoComplete="off" >
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div class="layui-form-mid layui-word-aux"
                                             style="color: red !important;padding: 10px !important;">*
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs11">
                                        <label class="layui-form-label">检查日期</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="createDateString" id="createDateString"
                                                   autocomplete="off" placeholder="请输入检查日期"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">出水水质酸碱度(pH)</label>
                                        <div class="layui-input-block">
                                            <input name="cph" id="cph"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="cphbz" style="padding: 10px !important;"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="cphg" style="color: green !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">合格
                                        </div>
                                        <div hidden id="cpbhg" style="color: red !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">出水水质化学需氧量(COD<sub>cr</sub>)</label>
                                        <div class="layui-input-block">
                                            <input name="chxxyl" id="chxxyl"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="chxxylbz" style="padding: 10px !important;"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="chxxylhg" style="color: green !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">合格
                                        </div>
                                        <div hidden id="chxxylbhg" style="color: red !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">出水水质氨氮(NH<sub>3</sub>-N)</label>
                                        <div class="layui-input-block">
                                            <input name="cad" id="cad"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="cadbz" style="padding: 10px !important;"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="cadhg" style="color: green !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">合格
                                        </div>
                                        <div hidden id="cadbhg" style="color: red !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">出水水质总氮(TN)</label>
                                        <div class="layui-input-block">
                                            <input name="czd" id="czd"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="czdbz" style="padding: 10px !important;"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="czdhg" style="color: green !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">合格
                                        </div>
                                        <div hidden id="czdbhg" style="color: red !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">出水水质总磷(TP)</label>
                                        <div class="layui-input-block">
                                            <input name="czl" id="czl"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="czlbz" style="padding: 10px !important;"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="czlhg" style="color: green !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">合格
                                        </div>
                                        <div hidden id="czlbhg" style="color: red !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">出水水质悬浮物(SS)</label>
                                        <div class="layui-input-block">
                                            <input name="cxfw" id="cxfw"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="cxfwbz" style="padding: 10px !important;"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="cxfwhg" style="color: green !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">合格
                                        </div>
                                        <div hidden id="cxfwbhg" style="color: red !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">出水水质粪大肠菌群数</label>
                                        <div class="layui-input-block">
                                            <input name="cfdcjqs" id="cfdcjqs"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="cfdcjqsbz" style="padding: 10px !important;"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="cfdcjqshg" style="color: green !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">合格
                                        </div>
                                        <div hidden id="cfdcjqsbhg" style="color: red !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">出水水质动植物油</label>
                                        <div class="layui-input-block">
                                            <input name="cdzwy" id="cdzwy"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="cdzwybz" style="padding: 10px !important;"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="cdzwyhg" style="color: green !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">合格
                                        </div>
                                        <div hidden id="cdzwybhg" style="color: red !important;padding: 10px !important;    width: 100px;
    margin-top: -10px;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">进水水质酸碱度(PH)</label>
                                        <div class="layui-input-block">
                                            <input name="jph" id="jph"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="jphbz" ></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="jphhg" style="color: green !important;padding: 10px !important;">合格
                                        </div>
                                        <div hidden id="jphbhg" style="color: red !important;padding: 10px !important;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">进水水质化学需氧量(COD<sub>cr</sub>)</label>
                                        <div class="layui-input-block">
                                            <input name="jhxxyl" id="jhxxyl"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="jhxxylbz"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="jhxxylhg" style="color: green !important;padding: 10px !important;">合格
                                        </div>
                                        <div hidden id="jhxxylbhg" style="color: red !important;padding: 10px !important;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">进水水质氨氮(NH<sub>3</sub>-N)</label>
                                        <div class="layui-input-block">
                                            <input name="jad" id="jad"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="jadbz"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="jadhg" style="color: green !important;padding: 10px !important;">合格
                                        </div>
                                        <div hidden id="jadbhg" style="color: red !important;padding: 10px !important;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">进水水质总氮(TN)</label>
                                        <div class="layui-input-block">
                                            <input name="jzd" id="jzd"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="jzdbz"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="jzdhg" style="color: green !important;padding: 10px !important;">合格
                                        </div>
                                        <div hidden id="jzdbhg" style="color: red !important;padding: 10px !important;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">进水水质总磷(TP)</label>
                                        <div class="layui-input-block">
                                            <input name="jzl" id="jzl"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="jzlbz"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="jzlhg" style="color: green !important;padding: 10px !important;">合格
                                        </div>
                                        <div hidden id="jzlbhg" style="color: red !important;padding: 10px !important;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">进水水质悬浮物(SS)</label>
                                        <div class="layui-input-block">
                                            <input name="jxfw" id="jxfw"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="jxfwbz"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="jxfwhg" style="color: red !important;padding: 10px !important;">合格
                                        </div>
                                        <div hidden id="jxfwbhg" style="color: green !important;padding: 10px !important;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">进水水质粪大肠菌群数</label>
                                        <div class="layui-input-block">
                                            <input name="jfdcjqs" id="jfdcjqs"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="jfdcjqsbz"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="jfdcjqshg" style="color: red !important;padding: 10px !important;">不合格
                                        </div>
                                        <div hidden id="jfdcjqsbhg" style="color: green !important;padding: 10px !important;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-col-lg6">
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">进水水质动植物油</label>
                                        <div class="layui-input-block">
                                            <input name="jdzwy" id="jdzwy"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <span id="jdzwybz"></span>
                                    </div>
                                    <div class="layui-col-xs1">
                                        <div hidden id="jdzwyhg" style="color: red !important;padding: 10px !important;">不合格
                                        </div>
                                        <div hidden id="jdzwybhg" style="color: green !important;padding: 10px !important;">不合格
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>

                </div>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-footer" style="left: 0;padding: 0px;">
                        <button class="layui-btn" lay-submit lay-filter="*" id="pushButton">立即提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/layui.all.js"></script>
<script src="<%=request.getContextPath()%>/huazhi/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script src="<%=request.getContextPath()%>/huazhi/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script>

    var hxxyy = 0
    var dzwy = 0
    var andan = 0
    var zongdan = 0
    var xfklw = 0
    var zl = 0
    var pdcgj = 0
    var ph = 0
    function child(id) {
        layui.use(['form', 'laydate', 'layer', 'laypage'], function () {
            var $ = layui.$
                , form = layui.form
                , laydate = layui.laydate
                , layer = layui.layer;

            //路径
            var curWwwPath = window.document.location.href;
            var pathName = window.document.location.pathname;
            var pos = curWwwPath.indexOf(pathName);
            var localhostPath = curWwwPath.substring(0, pos);
            var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);

            laydate.render({
                elem: '#createDateString' //指定元素
            });

            <%--$.ajax({--%>
            <%--    type: "get",--%>
            <%--    url: "<%=request.getContextPath()%>/rest/base/seleAllZrc",--%>
            <%--    dataType: "json",--%>
            <%--    async: false,--%>
            <%--    success: function (msg) {--%>
            <%--        var content = '<option value="">请选择</option>';--%>
            <%--        var xzSelect = $("#cun");--%>
            <%--        for (var i = 0; i < msg.zrcList.length; i++) {--%>
            <%--            content += '<option value="' + msg.zrcList[i].title + '">' + msg.zrcList[i].title + '</option>';--%>
            <%--            ;--%>
            <%--        }--%>
            <%--        xzSelect.append(content)--%>
            <%--        form.render();--%>
            <%--    }--%>
            <%--})--%>
            // form.on('select(cun-filter)', function (data) {
            // csh(data.value)
            // })


            // form.on('select(cun)',function (data){
            //
            // })

            var inputCun = document.getElementById("cun");

            //获得焦点
            inputCun.onfocus=function (){

                layer.open({
                    title: "自然村选择",
                    type: 2,
                    content: localhostPath + projectName + '/rest/getRoute?type=instrument&url=treeSel',
                    //是否显示右上角关闭图标，默认为1，显示
                    area: ['90%', '91%'],
                    maxmin: true,
                    shade: 0.6,
                    anim: 4,
                    skin: 'layui-layer-molv',
                    resize: true,
                    success: function (layero, index) {  //当你需要在层创建完毕时即执行一些语句，可以通过该回调 想相当于吧值转到子界面
                        var iframe = window['layui-layer-iframe' + index];
                    }
                });
            }

            function isNumber(val) {
                if(val == null || val == ''){
                    return  false
                }
                var regPos = /^\d+(\.\d+)?$/; //非负浮点数
                var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
                if(regPos.test(val) || regNeg.test(val)) {
                    return true;
                } else {
                    return false;
                }
            }


            $("#cph").bind("input propertychang", function (event) {

                if (this.value == "") {
                    document.getElementById("cphg").style.display = "none";
                    document.getElementById("cpbhg").style.display = "none";
                    return true
                }
                var inputValue = parseInt(this.value);
                cshph(inputValue)
            })

            function  cshph(inputValue){

                if (inputValue < 6 || inputValue > 9) {
                    document.getElementById("cphg").style.display = "none";
                    document.getElementById("cpbhg").style.display = "block";
                } else {
                    document.getElementById("cpbhg").style.display = "none";
                    document.getElementById("cphg").style.display = "block";
                }
            }


            $("#chxxyl").bind("input propertychang", function (event) {

                if (this.value == "") {
                    document.getElementById("chxxylhg").style.display = "none";
                    document.getElementById("chxxylbhg").style.display = "none";
                    return true
                }
                var inputValue = parseInt(this.value);
                cshhxxyl(inputValue)
            })
            function  cshhxxyl(inputValue){

                if (inputValue > hxxyy) {
                    document.getElementById("chxxylhg").style.display = "none";
                    document.getElementById("chxxylbhg").style.display = "block";
                } else {
                    document.getElementById("chxxylbhg").style.display = "none";
                    document.getElementById("chxxylhg").style.display = "block";
                }
            }


            $("#cad").bind("input propertychang", function (event) {

                if (this.value == "") {
                    document.getElementById("cadhg").style.display = "none";
                    document.getElementById("cadbhg").style.display = "none";
                    return true
                }
                var inputValue = parseInt(this.value);
                cshcad(inputValue)

            })
            function cshcad(inputValue){

                if (inputValue > andan) {
                    document.getElementById("cadhg").style.display = "none";
                    document.getElementById("cadbhg").style.display = "block";
                } else {
                    document.getElementById("cadbhg").style.display = "none";
                    document.getElementById("cadhg").style.display = "block";
                }
            }

            $("#czd").bind("input propertychang", function (event) {

                if (this.value == "") {
                    document.getElementById("czdhg").style.display = "none";
                    document.getElementById("czdbhg").style.display = "none";
                    return true
                }
                var inputValue = parseInt(this.value);
                cshczd(inputValue)
            })
           function cshczd(inputValue){
                if (inputValue > zongdan) {
                    document.getElementById("czdhg").style.display = "none";
                    document.getElementById("czdbhg").style.display = "block";
                } else {
                    document.getElementById("czdbhg").style.display = "none";
                    document.getElementById("czdhg").style.display = "block";
                }
            }



            $("#czl").bind("input propertychang", function (event) {

                if (this.value == "") {
                    document.getElementById("czlhg").style.display = "none";
                    document.getElementById("czlbhg").style.display = "none";
                    return true
                }
                var inputValue = parseInt(this.value);
                cshczl(inputValue)
            })
            function cshczl(inputValue){

                if (inputValue > zl) {
                    document.getElementById("czlhg").style.display = "none";
                    document.getElementById("czlbhg").style.display = "block";
                } else {
                    document.getElementById("czlbhg").style.display = "none";
                    document.getElementById("czlhg").style.display = "block";
                }
            }

            $("#cxfw").bind("input propertychang", function (event) {
                if (this.value == "") {
                    document.getElementById("cxfwhg").style.display = "none";
                    document.getElementById("cxfwbhg").style.display = "none";
                    return true
                }
                var inputValue = parseInt(this.value);
                cshcxfw(inputValue)
            })
            function  cshcxfw(inputValue){
                if (inputValue > xfklw) {
                    document.getElementById("cxfwhg").style.display = "none";
                    document.getElementById("cxfwbhg").style.display = "block";
                } else {
                    document.getElementById("cxfwbhg").style.display = "none";
                    document.getElementById("cxfwhg").style.display = "block";
                }
            }

            $("#cfdcjqs").bind("input propertychang", function (event) {
                if (inputValue == "") {
                    document.getElementById("cfdcjqshg").style.display = "none";
                    document.getElementById("cfdcjqsbhg").style.display = "none";
                    return true
                }
                var inputValue = parseInt(this.value);
                cshdcgj(inputValue)
            })
            function cshdcgj(inputValue){
                if (inputValue > pdcgj) {
                    document.getElementById("cfdcjqshg").style.display = "none";
                    document.getElementById("cfdcjqsbhg").style.display = "block";
                } else {
                    document.getElementById("cfdcjqsbhg").style.display = "none";
                    document.getElementById("cfdcjqshg").style.display = "block";
                }
            }

            $("#cdzwy").bind("input propertychang", function (event) {

                if (this.value == "") {
                    document.getElementById("cdzwyhg").style.display = "none";
                    document.getElementById("cdzwybhg").style.display = "none";
                    return true
                }
                var inputValue = parseInt(this.value);
                cshdzwy(inputValue)
            })

            function cshdzwy(inputValue){
                if (inputValue > dzwy) {
                    document.getElementById("cdzwyhg").style.display = "none";
                    document.getElementById("cdzwybhg").style.display = "block";
                } else {
                    document.getElementById("cdzwybhg").style.display = "none";
                    document.getElementById("cdzwyhg").style.display = "block";
                }
            }

            //自定义验证规则
            form.verify({});

            $.ajax({
                type: "get",
                url: "<%=request.getContextPath()%>/rest/base/getSzjcById",
                dataType: "json",
                async: true,
                data: "id=" + id,
                success: function (data) {
                    csh(data.cun)
                    if(isNumber(data.cph)){
                        cshph(data.cph)
                    }
                    if(isNumber(data.chxxyl)){
                      cshhxxyl(data.chxxyl)
                    }
                    if(isNumber(data.cad)){
                        cshcad(data.cad)
                    }
                    if(isNumber(data.czd)){
                        cshczd(data.czd)
                    }
                    if(isNumber(data.cxfw)){
                        cshcxfw(data.cxfw)
                    }
                    if(isNumber(data.cfdcjqs)){
                        cshdcgj(data.cfdcjqs)
                    }
                    if(isNumber(data.cdzwy)){
                        cshdzwy(data.cdzwy)
                    }
                    if(isNumber(data.czl)){
                        console.log(data.czl)
                        cshczl(data.czl)
                    }
                    form.val("component-form-element", data);
                }
            })


            //第一种方法添加用户
            form.on('submit(*)', function (data) {
                var field = data.field//当前容器的全部表单字段，名值对形式：{name: value}
                var name = field.name;
                var flag = true;
                var index = layer.msg('数据提交中，请稍候', {icon: 16, time: false, shade: 0.6});
                $("#pushButton").addClass("layui-btn layui-btn-disabled").prop("disabled", true);
                console.log("维修记录")
                console.log(field)
                $.ajax({
                    type: "post",
                    url: "<%=request.getContextPath()%>/rest/base/updateSzjc",
                    data: field,
                    dataType: "json",
                    async: false,
                    success: function (obj) {
                        setTimeout(function () {
                            layer.close(index);
                            if (obj === true) {
                                layer.msg('修改成功');
                            } else {
                                layer.msg(obj.errorMsg);
                            }
                        }, 2000);
                        setTimeout(function () {
                            var indexs = parent.layer.getFrameIndex(window.name);//获取当前弹出层的层级
                            parent.layer.close(indexs);//关闭弹出层
//                        window.parent.location.reload();//刷新父页面
                        }, 4000);
                    }
                })
                return false;
            });




        });
    }

    function getCheckCun(cunname){
        document.getElementById("cun").value = cunname
        csh(cunname)
    }

    function csh(value){
        $.ajax({
            type: "post",
            url: "<%=request.getContextPath()%>/rest/base/getLineByCunziForSzjc",
            dataType: "json",
            async: false,
            data: {
                'cun': value,
            },
            success: function (msg) {
                if (msg.csbz == "一级") {
                    hxxyy = 60
                    dzwy = 3
                    andan = 8
                    zongdan = 20
                    xfklw = 20
                    zl = 1
                    pdcgj = 10

                } else if (msg.csbz == "二级") {
                    hxxyy = 80
                    dzwy = 5
                    andan = 20
                    zongdan = 10000
                    xfklw = 30
                    zl = 3
                    pdcgj = 10000

                } else {
                    hxxyy = 120
                    dzwy = 20
                    andan = 25
                    zongdan = 10000
                    xfklw = 60
                    zl = 10000
                    pdcgj = 10000
                }
                document.getElementById("cadbz").innerText = andan
                document.getElementById("cphbz").innerText = '6-9'
                document.getElementById("chxxylbz").innerText = hxxyy
                if(zongdan == 10000){
                    document.getElementById("czdbz").innerText = ""
                }else {
                    document.getElementById("czdbz").innerText = zongdan
                }
                document.getElementById("czlbz").innerText = zl
                if(xfklw == 10000){
                    document.getElementById("cxfwbz").innerText = ""
                }else {
                    document.getElementById("cxfwbz").innerText = xfklw
                }
                if(pdcgj == 10000){
                    document.getElementById("cfdcjqsbz").innerText = ""
                }else {
                    document.getElementById("cfdcjqsbz").innerText = pdcgj
                }
                document.getElementById("cdzwybz").innerText = dzwy
            }
        })
    }

    function getCheckCun(cunname){
        document.getElementById("cun").value = cunname
        $.ajax({
            type: "post",
            url: "<%=request.getContextPath()%>/rest/base/getLineByCunzi",
            dataType: "json",
            async: false,
            data:{
                'cun':cunname,
            },
            success: function (msg) {
                if(msg.csbz == "一级" ){
                    hxxyy =60
                    dzwy = 3
                    andan = 8
                    zongdan = 20
                    xfklw = 20
                    zl= 1
                    pdcgj =10

                }else if (msg.csbz == "二级"){
                    hxxyy =80
                    dzwy = 5
                    andan = 20
                    zongdan = 10000
                    xfklw = 30
                    zl= 3
                    pdcgj =10000

                }else {
                    hxxyy =120
                    dzwy = 20
                    andan = 25
                    zongdan = 10000
                    xfklw = 60
                    zl= 10000
                    pdcgj =10000
                }
                document.getElementById("cadbz").innerText = andan
                document.getElementById("cphbz").innerText = '6-9'
                document.getElementById("chxxylbz").innerText = hxxyy
                if(zongdan == 10000){
                    document.getElementById("czdbz").innerText = ""
                }else {
                    document.getElementById("czdbz").innerText = zongdan
                }
                document.getElementById("czlbz").innerText = zl
                if(xfklw == 10000){
                    document.getElementById("cxfwbz").innerText = ""
                }else {
                    document.getElementById("cxfwbz").innerText = xfklw
                }
                if(pdcgj == 10000){
                    document.getElementById("cfdcjqsbz").innerText = ""
                }else {
                    document.getElementById("cfdcjqsbz").innerText = pdcgj
                }
                document.getElementById("cdzwybz").innerText = dzwy
            }
        })

    }




</script>
</body>
</html>